package zoran.wang;

import org.springframework.beans.BeansException;
import org.springframework.beans.factory.config.BeanPostProcessor;
import org.springframework.stereotype.Component;

/**
 * description：
 *
 * @author wangzhuo
 * @date 2022/3/19 17:30
 * @Email zoranwang@yeah.net
 */
@Component
public class myPostProcessor implements BeanPostProcessor {
    @Override
    public Object postProcessBeforeInitialization(Object bean, String beanName) throws BeansException {

        System.out.println("Initialization start ====== " + beanName);

        return BeanPostProcessor.super.postProcessBeforeInitialization(bean, beanName);
    }

    @Override
    public Object postProcessAfterInitialization(Object bean, String beanName) throws BeansException {

        System.out.println("Initialization finish ====== " + beanName);

        return BeanPostProcessor.super.postProcessAfterInitialization(bean, beanName);
    }
}
